'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 1999 Sun Microsystems, Inc.  All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH ACCTCON 8 "Feb 22, 1999"
.SH NAME
acctcon, acctcon1, acctcon2 \- connect-time accounting
.SH SYNOPSIS
.LP
.nf
\fB/usr/lib/acct/acctcon\fR [\fB-l\fR \fIlineuse\fR] [\fB-o\fR \fIreboot\fR]
.fi

.LP
.nf
\fB/usr/lib/acct/acctcon1\fR [\fB-p\fR] [\fB-t\fR] [\fB-l\fR \fIlineuse\fR] [\fB-o\fR \fIreboot\fR]
.fi

.LP
.nf
\fB/usr/lib/acct/acctcon2\fR
.fi

.SH DESCRIPTION
.sp
.LP
\fBacctcon\fR converts a sequence of login/logoff records to total accounting
records (see the \fBtacct\fR format in \fBacct.h\fR(3HEAD)). The login/logoff
records are read from standard input.  The file \fB/var/adm/wtmpx\fR is usually
the source of the login/logoff records; however, because it might contain
corrupted records or system date changes, it should first be fixed using
\fBwtmpfix\fR. The fixed version of file \fB/var/adm/wtmpx\fR can then be
redirected to \fBacctcon\fR. The \fBtacct\fR records are written to standard
output.
.sp
.LP
\fBacctcon\fR is a combination of the programs \fBacctcon1\fR and
\fBacctcon2\fR. \fBacctcon1\fR converts login/logoff records, taken from the
fixed \fB/var/adm/wtmpx\fR file, to ASCII output. \fBacctcon2\fR reads the
ASCII records produced by \fBacctcon1\fR and converts them to \fBtacct\fR
records. \fBacctcon1\fR can be used with the \fB-l\fR and \fB-o\fR options,
described below, as well as with the \fB-p\fR and \fB-t\fR options.
.SH OPTIONS
.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 14n
Print input only, showing line name, login name, and time (in both numeric and
date/time formats).
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 14n
\fBacctcon1\fR maintains a list of lines on which users are logged in. When it
reaches the end of its input, it emits a session record for each line that
still appears to be active. It normally assumes that its input is a current
file, so that it uses the current time as the ending time for each session
still in progress. The \fB-t\fR flag causes it to use, instead, the last time
found in its input, thus assuring reasonable and repeatable numbers for
non-current files.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR \fIlineuse\fR\fR
.ad
.RS 14n
\fIlineuse\fR is created to contain a summary of line usage showing line name,
number of minutes used, percentage of total elapsed time used, number of
sessions charged, number of logins, and number of logoffs.  This file helps
track line usage, identify bad lines, and find software and hardware oddities.
Hangup, termination of \fBlogin\fR(1) and termination of the login shell each
generate logoff records, so that the number of logoffs is often three to four
times the number of sessions. See \fBinit\fR(8) and \fButmpx\fR(5).
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIreboot\fR\fR
.ad
.RS 14n
\fBreboot\fR is filled with an overall record for the accounting period, giving
starting time, ending time, number of reboots, and number of date changes.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRUsing the \fBacctcon\fR command.
.sp
.LP
The \fBacctcon\fR command is typically used as follows:

.sp
.in +2
.nf
example% acctcon \fB-l\fR lineuse \fB-o\fR reboots < tmpwtmp > ctacct
.fi
.in -2
.sp

.sp
.LP
The \fBacctcon1\fR and \fBacctcon2\fR commands are typically used as follows:

.sp
.in +2
.nf
example% acctcon1 \fB-l\fR lineuse \fB-o\fR reboots < tmpwtmp | sort +1n +2 > ctmp
example% acctcon2 < ctmp > ctacct
.fi
.in -2
.sp

.SH FILES
.sp
.ne 2
.na
\fB\fB/var/adm/wtmpx\fR\fR
.ad
.RS 18n
History of user access and administration information
.RE

.SH SEE ALSO
.sp
.LP
.BR acctcom (1),
.BR login (1),
.BR acct (2),
.BR acct.h (3HEAD),
.BR utmpx (5),
.BR attributes (7),
.BR acct (8),
.BR acctcms (8),
.BR acctmerg (8),
.BR acctprc (8),
.BR acctsh (8),
.BR fwtmp (8),
.BR init (8),
.BR runacct (8)
.sp
.LP
\fI\fR
.SH NOTES
.sp
.LP
The line usage report is confused by date changes. Use \fBwtmpfix\fR (see
\fBfwtmp\fR(8)), with the \fB/var/adm/wtmpx\fR file as an argument, to correct
this situation.
.sp
.LP
During a single invocation of any given command, the \fBacctcon\fR,
\fBacctcon1\fR, and \fBacctcon2\fR commands can process a maximum of:
.RS +4
.TP
.ie t \(bu
.el o
6000 distinct session
.RE
.RS +4
.TP
.ie t \(bu
.el o
1000 distinct terminal lines
.RE
.RS +4
.TP
.ie t \(bu
.el o
2000 distinct login names
.RE
.sp
.LP
If at some point the actual  number of any one of these items exceeds the
maximum, the command will not succeed.
